#region Using Directives

using System;
using Microsoft.Practices.ComponentModel;
using Microsoft.Practices.RecipeFramework;

using EnvDTE;
using EnvDTE80;

#endregion

namespace EEst.SoftwareFactory.Actions
{
    class AddProjectToSolutionFolderAction : Action
    {
        #region Input Properties

        [Input]
        public Project SolutionProject
        {
            get { return solutionProject; }
            set { solutionProject = value; }
        } Project solutionProject;

        [Input]
        public string ProjectFile
        {
            get { return projectFile; }
            set { projectFile = value; }
        }
        string projectFile;
        #endregion

        #region Output Properties

        [Output]
        public Project AddedProject
        {
            get { return addedProject; }
            set { addedProject = value; }
        } Project addedProject;

        #endregion

        #region IAction Members

        public override void Execute()
        {
            SolutionFolder folder = (SolutionFolder)solutionProject.Object;
            addedProject = folder.AddFromFile(projectFile);
        }

        public override void Undo()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }
}
